package com.example.dao;

import com.baomidou.mybatisplus.core.toolkit.AES;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCrypt;
import org.springframework.security.crypto.password.PasswordEncoder;

@SpringBootTest
public class RandomKey {
    @Test
    void key() {
        String randomKey = AES.generateRandomKey();
        String url = AES.encrypt("jdbc:mysql://127.0.0.1/mybatis_plus?characterEncoding=utf8",randomKey);
        String root = AES.encrypt("root",randomKey);

        String pwd = AES.encrypt("123456",randomKey);

        System.out.println(url);
        System.out.println(root);

        System.out.println(pwd);
        System.out.println(randomKey);

    }

    @Autowired
    private PasswordEncoder passwordEncoder;
    @Test
    public void test1() {

        String encodePassword = BCrypt.hashpw();
    }
}
